package project.menu.garagemenu;

import api.controller.IAutoservice;
import project.controllers.CreatorObject;
import project.controllers.Messager;
import project.controllers.Printer;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;

public class CreatorGarage implements IMenuItem {
	private String name = "Add garage";
	private final Integer id = 4;
	private static IMenu submenu;
	private Navigator navigator;
	
	
	public CreatorGarage(){
		navigator=Navigator.getInstance();
		
	}

	
	public static void setSubmenu(IMenu menu){
		 submenu=menu;
	}
	
	public void action(IAutoservice autoservice) {
	//add garage
		
		autoservice.addGarage(CreatorObject.addGarage());
		Printer.printMessage(Messager.GARAGE_ADD);
		navigator.drawMenu(submenu);
		

	}

	public String getNameItem() {
		return name;
	}

	
	public Integer getId(){
		return id;
	}
	
	

}
